package com.yufei.controller;

import com.yufei.dao.LoginDao;
import com.yufei.domain.Login;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
// 允许跨域
@CrossOrigin
public class LoginController {
    @Autowired
    private LoginDao loginDao;

    @GetMapping("/login")
    public List<Login> login() {
        return loginDao.selectList(null);
    }
}
